Application Development with Qt Creator, Third Edition by Lee Zhi Eng
Author:Lee Zhi Eng [Lee Zhi Eng]
Language: eng
Format: epub, mobi
Tags: COM051070 - COMPUTERS / Programming Languages / C++, COM070000 - COMPUTERS / User Interfaces, COM051230 - COMPUTERS / Software Development and Engineering / General
Publisher: Packt
Published: 2020-01-31T13:30:58+00:00
This code creates a window of 360 pixels in height and width, and two rectangles. Qt places the first rectangle centered in the parent window, and it places the second rectangle to the right-hand side of the first one with the same top lines.
Anchoring doesn't just affect placement, but it can affect sizing too. Consider the following QML:
import QtQuick 2.12 import QtQuick.Window 2.12 Window { visible: true width: 360 height: 360 Rectangle { id: rect1 height: 100 width: 100 anchors.left: parent.left; anchors.verticalCenter: parent.verticalCenter color: "gray" } Rectangle { id: rect2 anchors.left: rect1.right anchors.top: rect1.top; anchors.bottom: rect1.bottom anchors.right: rect3.left color: "black" } Rectangle { id: rect3 height: 100 width: 100 anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter color: "gray" } }
This places two squares on either side of the parent window, with a rectangle stretched between the two squares. Note that the anchor.left parameter of rect2 is set to the rect1.right value, and anchor.right of rect2 is set to the rect3.left value. The following screenshot shows how it looks:
Download
Application Development with Qt Creator, Third Edition by Lee Zhi Eng.mobi
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7808)
Grails in Action by Glen Smith Peter Ledbrook(7719)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6828)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6828)
Running Windows Containers on AWS by Marcio Morales(6354)
Kotlin in Action by Dmitry Jemerov(5090)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(5064)
Combating Crime on the Dark Web by Nearchos Nearchou(4640)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4603)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4437)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4330)
The Age of Surveillance Capitalism by Shoshana Zuboff(3979)
Python for Security and Networking - Third Edition by José Manuel Ortega(3890)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3550)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3528)
Learn Wireshark by Lisa Bock(3520)
Mastering Python for Networking and Security by José Manuel Ortega(3376)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3355)
Blockchain Basics by Daniel Drescher(3324)
